package com.io.testResources;

import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.lang.Console;

import java.io.IOException;
import java.util.Properties;

/**
 * @author keyer
 * @Description : 描述
 * Created by cyd on 2021-04-15 17:08:20
 */
public class TestClassPathResources {
    public static void main(String[] args) throws IOException {
        ClassPathResource resource = new ClassPathResource("example.properties");
        Properties properties = new Properties();
        properties.load(resource.getStream());

        Console.log("Properties: {}", properties);
        Console.log(properties.getProperty("name"));
        Console.log(properties.getProperty("name2"));
    }
}
